import { defineConfig } from "vite";
import { resolve } from "path";
import setupVitePlugins from "./vite/plugins";
import { loadEnv } from "vite";

export default defineConfig(({ command, mode }) => {
  {
    const env = loadEnv(mode, process.cwd());
    return {
      plugins: setupVitePlugins(env, command === "build"),
      resolve: {
        alias: {
          "@": resolve(__dirname, "src"),
        },
      },
    };
  }
});
